package main

import (
	"fmt"
	"runtime"
	"time"
)

func main() {
	go func() {
		fmt.Println("goroutine 开始")
		fun()
		fmt.Println("goroutine 结束")
	}()

	time.Sleep(3 * time.Second)

}

func fun() {

	defer fmt.Println("deffer 执行")
	runtime.Goexit()
	fmt.Println("fun 函数执行完毕")
}
